import { Module } from "@nestjs/common";
import { AuthService } from "./auth.service";
import { AuthController } from "./auth.controller";
import { PassportModule } from "@nestjs/passport";
import { TypeOrmModule } from "@nestjs/typeorm";
import { JwtModule } from "@nestjs/jwt";
import { JwtStorage, RefreshJwtStrategy } from "./jwt.strategy";
import { HttpModule } from "@nestjs/axios";
import { Users } from "../users/entities/user.entity";
import { UsersModule } from "../users/users.module";
import { UsersService } from "../users/users.service";
// const jwtModule = JwtModule.registerAsync({
//   inject: [ConfigService],
//   useFactory: async (configService: ConfigService) => {
//     return {
//       secret: configService.get('SECRET'),
//       signOptions: { expiresIn: '4h' },
//     };
//   },
// });
@Module({
	imports: [
		TypeOrmModule.forFeature([Users]),
		PassportModule,
		JwtModule,
		UsersModule,
		HttpModule
	],
	controllers: [AuthController],
	providers: [AuthService, UsersService, JwtStorage, RefreshJwtStrategy]
})
export class AuthModule {}
